
package jason.asSyntax.directives;

import jason.asSemantics.Agent;
import jason.asSyntax.*;
import jason.asSyntax.parser.Token;
import jason.asSyntax.parser.as2j;
import jason.mas2j.MAS2JProject;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;

/** Implementation of the <code>export</code> directive. */
public class Export implements Directive {
	static Logger logger = Logger.getLogger(Export.class.getName());
	
	public Agent process(Atom directive, Agent outerContent, Agent innerContent, Token token) {
		if (outerContent == null) return null;
		
		if (!(directive instanceof Exportive)) {
			logger.log(Level.SEVERE, "The directive supposed to be an export, instead of: " + directive.getClass() + " of the directive: " + directive);
			return null;
		}
		
		Exportive exportive = (Exportive)directive;
		outerContent.addExports(exportive.getPreds());
		return null;
	}
}
